import { createRouter, createWebHistory } from 'vue-router'
// import HomeView from '../views/HomeView.vue'

// 静态路由表
export const userRoutes = [
  {
    path: '/',
    component: () => import('@/views/login/index.vue'),
  },
  {
    path: '/main',
    component: () => import('@/Loyout/index.vue'),
    children: [
      {
        path: '/home',
        component: () => import('@/views/home.vue')
      },
    ]
  }
]

// 动态路由表
export const adminRoutes = [

  {
    path: '/setting',
    component: () => import('@/Loyout/index.vue'),
    mata: { roles: ['amdin','user'] },
    children: [
      {
        path: 'users',
        component: () => import('@/views/setting/users.vue')
      },
      {
        path: 'role',
        component: () => import('@/views/setting/role.vue')
      },
      {
        path: 'dept',
        component: () => import('@/views/setting/department.vue')
      },
      {
        path: 'dept2',
        component: () => import('@/views/setting/dept.vue')
      },
      {
        path: 'menu',
        component: () => import('@/views/setting/menu.vue')
      }
    ]
  },
  {
    path: '/ruoyi',
    mata: { roles: ['user'] },
    component: () => import('@/views/ruoyi.vue')
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: userRoutes
})

export default router
